﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;

namespace DataModels.Models
{
    /// <summary>
    /// Query Parameter
    /// </summary>
    public class QueryParameter :ModelBase
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        /// <summary>
        /// Parameter name
        /// </summary>
        [Required]
        [StringLength(200)]
        public string Name { get; set; }

        /// <summary>
        /// Parameter description
        /// </summary>
        [Required]
        [StringLength(1000)]
        public string Description { get; set; }

        /// <summary>
        /// Regular expression to validate the input value of the parameter.
        /// </summary>
        [Required]
        [StringLength(1000)]
        public string ValidationExpression { get; set; }

        /// <summary>
        /// The assembly-qualified name of the type. If the type is in the currently executing
        /// assembly or in Mscorlib.dll, it is sufficient to supply the type name qualified by
        /// its namespace.
        /// </summary>
        /// <remarks>
        /// The assembly-qualified name of a type consists of the type name, including its 
        /// namespace, followed by a comma, followed by the display name of the assembly. The 
        /// display name of an assembly is obtained using the Assembly.FullName property.
        /// </remarks>
        [Required]
        [StringLength(1000)]
        public string DataTypeName { get; set; }

        public int QueryId { get; set; }
    }
}
